<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>zxxhouse: src/com/soufang/ui/SingleFragmentActivity.java源文件</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">zxxhouse
   &#160;<span id="projectnumber">1.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- 制作者 Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">src/com/soufang/ui/SingleFragmentActivity.java</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="keyword">package </span>com.soufang.ui;
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="keyword">import</span> android.os.Bundle;
<a name="l00004"></a>00004 <span class="keyword">import</span> android.support.v4.app.Fragment;
<a name="l00005"></a>00005 <span class="keyword">import</span> android.support.v4.app.FragmentActivity;
<a name="l00006"></a>00006 <span class="keyword">import</span> android.support.v4.app.FragmentManager;
<a name="l00007"></a>00007 
<a name="l00013"></a><a class="code" href="classcom_1_1soufang_1_1ui_1_1_single_fragment_activity.html">00013</a> <span class="keyword">public</span> <span class="keyword">abstract</span> <span class="keyword">class </span><a class="code" href="classcom_1_1soufang_1_1ui_1_1_single_fragment_activity.html" title="fragment管理页面">SingleFragmentActivity</a> <span class="keyword">extends</span> FragmentActivity {
<a name="l00014"></a>00014     <span class="keyword">protected</span> <span class="keyword">abstract</span> Fragment createFragment();
<a name="l00015"></a>00015 
<a name="l00016"></a>00016     @Override
<a name="l00017"></a>00017     <span class="keyword">public</span> <span class="keywordtype">void</span> onCreate(Bundle savedInstanceState) {
<a name="l00018"></a>00018         super.onCreate(savedInstanceState);
<a name="l00019"></a>00019         setContentView(R.layout.activity_fragment);
<a name="l00020"></a>00020         FragmentManager manager = getSupportFragmentManager();
<a name="l00021"></a>00021         Fragment fragment = manager.findFragmentById(R.id.fragmentContainer);
<a name="l00022"></a>00022 
<a name="l00023"></a>00023         <span class="keywordflow">if</span> (fragment == null) {
<a name="l00024"></a>00024             fragment = createFragment();
<a name="l00025"></a>00025             manager.beginTransaction()
<a name="l00026"></a>00026                 .add(R.id.fragmentContainer, fragment)
<a name="l00027"></a>00027                 .commit();
<a name="l00028"></a>00028         }
<a name="l00029"></a>00029     }
<a name="l00030"></a>00030 }
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated at 2015年二月4日 星期三 18:11:09 for zxxhouse by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
